/**
 * 
 */
package com.swim.natatoriuminfo.entity;

import java.sql.Date;

import javax.validation.Valid;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
import com.jeesite.common.utils.excel.annotation.ExcelFields;

/**
 * 访问量统计Entity
 * @author ljw
 * @version 2022-07-05
 */
@Table(name="t_click_stats", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="natatorium_info_id", attrName="natatoriumInfoId", label="游泳馆信息id"),
		@Column(name="mobile", attrName="mobile", label="手机号"),
		@Column(name="position", attrName="position", label="定位"),
		@Column(name="ip", attrName="ip", label="ip地址"),
		@Column(name="mac", attrName="mac", label="mac地址"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class ClickStats extends DataEntity<ClickStats>  {
	
	private static final long serialVersionUID = 1L;
	private String natatoriumInfoId;		// 游泳馆信息id
	private String mobile;		// 手机号
	private String position;		// 定位
	private String ip;		// ip地址
	private String mac;		// mac地址
	
	//############## 附加属性 ###############
	private String yearMonthStr;	//年月
	private String year;	//年
	private String month;	//月
	
	//################### 利用jeesite4封装的查询  start ##########################
	//创建时间范围查询前端传参  createDateStartTime_gte、createDateEndTime_lte
	public Date getCreateDateStartTime_gte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.GTE);
	}
	
	public void setCreateDateStartTime_gte(Date createDateStartTime) {
		sqlMap.getWhere().and("create_date", QueryType.GTE, createDateStartTime);
	}
	
	public Date getCreateDateEndTime_lte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.LTE);
	}

	public void setCreateDateEndTime_lte(Date createDateEndTime) {
		sqlMap.getWhere().and("create_date", QueryType.LTE, createDateEndTime);
	}
	//################### 利用jeesite4封装的查询  end ##########################
	
	public ClickStats() {
		this(null);
	}

	public ClickStats(String id){
		super(id);
	}
	
	//实体导出Excel需要用到的注解
	@Valid
	@ExcelFields({
		@ExcelField(title="手机号", attrName="mobile", align=Align.CENTER, sort=10),
		@ExcelField(title="定位", attrName="position", align = Align.CENTER, sort=40),
		@ExcelField(title="ip地址", attrName="ip", align=Align.CENTER, sort=30),
		@ExcelField(title="mac", attrName="mac", align=Align.CENTER, sort=40),
		@ExcelField(title="访问时间", attrName="createDate", align=Align.CENTER, sort=40),
	})
	public String getNatatoriumInfoId() {
		return natatoriumInfoId;
	}

	public void setNatatoriumInfoId(String natatoriumInfoId) {
		this.natatoriumInfoId = natatoriumInfoId;
	}
	
	@Length(min=0, max=11, message="手机号长度不能超过 11 个字符")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@Length(min=0, max=100, message="定位长度不能超过 100 个字符")
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}
	
	@Length(min=0, max=15, message="ip地址长度不能超过 15 个字符")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
	@Length(min=0, max=100, message="mac地址长度不能超过 100 个字符")
	public String getMac() {
		return mac;
	}

	public void setMac(String mac) {
		this.mac = mac;
	}

	public String getYearMonthStr() {
		return yearMonthStr;
	}

	public void setYearMonthStr(String yearMonthStr) {
		this.yearMonthStr = yearMonthStr;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getMonth() {
		return month;
	}

	public void setMonth(String month) {
		this.month = month;
	}

	
}